package io.github.talelin.latticy.vo;

import io.github.talelin.latticy.entity.User;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

@Getter
@Setter
public class GroupIsUserVO {
    private Long id;
    private String nickname;
    private String avatar;
    private String name;

    public GroupIsUserVO (User user) {
        BeanUtils.copyProperties(user, this);
    }

    public static List<GroupIsUserVO> getList(List<User> userList) {
        return userList.stream()
                .map(GroupIsUserVO::new)
                .collect(Collectors.toList());
    }
}
